﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data;
using OgilvyOne.BLL;

public partial class allergy_plan_plan : System.Web.UI.Page
{
    protected string titles;
    protected string meta_kwords;
    protected string meta_desc;

    protected void Page_Load(object sender, EventArgs e)
    {
        //seo
        DataTable seodt = BLLArticleInfo.getSeoInfo("204");
        foreach (DataRow seorows in seodt.Rows)
        {
            titles = seorows["Columntitle"].ToString();
            meta_kwords = seorows["ColumnKeyword"].ToString();
            meta_desc = seorows["ColumnDesc"].ToString();
        }
        //如何预防宝宝过敏
        this.ruheyufang_rpt.DataSource = BLLArticleInfo.selectb("208");
        this.ruheyufang_rpt.DataBind();
        //母乳喂养预防宝宝过敏
        this.weiyang_rpt.DataSource = BLLArticleInfo.selectw("210");
        this.weiyang_rpt.DataBind();

        //最新问答推荐
        this.recommend_rpt.DataSource = BLLArticleInfo.getRecommendFAQ();
        this.recommend_rpt.DataBind();

        //专家博客
        this.right_rpt.DataSource = BLLArticleInfo.getFaqBlog();
        this.right_rpt.DataBind();
    }

    private int i = 2;
    protected void weiyang_rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        HtmlControl p = e.Item.FindControl("p") as HtmlControl;
        if (i % 2 == 0)
        {
            p.Attributes.Add("class", "falink1");
        }
        else
        {
            p.Attributes.Add("class", "falink");
        }
        i++;
    }
    private int ii = 5;
    protected void recommend_rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        HtmlControl r = e.Item.FindControl("r") as HtmlControl;
        if (5 / ii == 1)
        {
            //r.Attributes.Add("class", "selected");
        }
        ii--;
    }
}
